<% layout('/layouts/default.html', {title: '教师基本信息表管理', libs:
['dataGrid','validate']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header with-border">
			<div class="box-title">
				<i class="fa fa-list-alt"></i> ${text(empUser.isNewRecord ?
				'新增教师基本信息表' : '编辑教师基本信息表')}
			</div>
			<div class="box-tools pull-right">
				<button type="button" class="btn btn-box-tool"
					data-widget="collapse">
					<i class="fa fa-minus"></i>
				</button>
			</div>
		</div>

		<#form:form id="inputForm" model="${empUser}"
			action="${ctx}/sys/empUser/save" method="post"
			class="form-horizontal">
			<#form:hidden name="op" value="${op}" />
			<#form:hidden name="userType" value="employee" />
			<#form:hidden name="submitStatus" value="01" />
			<#form:hidden path="userCode" />
			<#form:hidden name="oldLoginCode" value="${empUser.loginCode}" />
			<div class="box-body">
				<div class="form-unit">${text('基本信息')}</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title=""> <span
								class="required "></span> ${text('姓名')}：<i
								class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="userName" maxlength="64"
									class="form-control " readonly="true" control-label="true" />
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title=""> <span
								class="required "></span> ${text('身份证号')}：<i
								class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="loginCode" maxlength="64"
									class="form-control " readonly="true" />
							</div>
						</div>
					</div>

					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title=""> <span
								class="required "></span> ${text('性别')}：<i
								class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:select path="sex" dictType="sys_user_sex"
									blankOption="true" class="form-control required" />
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title=""> <span
								class="required "></span> ${text('手机号')}：<i
								class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="mobile" maxlength="64"
									class="form-control required" />
							</div>
						</div>
					</div>

					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title=""> <span
								class="required "></span> ${text('国籍')}：<i
								class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:select path="extend.extendS1" dictType="js_sys_country"
									blankOption="true" class="form-control required" />

							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title=""> <span
								class="required "></span> ${text('民族')}：<i
								class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:select path="extend.extendS2" dictType="nation"
									blankOption="true" class="form-control required" />
							</div>
						</div>
					</div>

					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title=""> <span
								class="required "></span> ${text('政治面貌')}：<i
								class="fa icon-question hide"></i></label>
							<div class="col-sm-8">

								<#form:select path="extend.extendS3" dictType="political"
									blankOption="true" class="form-control required" />
							</div>
						</div>
					</div>

					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title=""> <span
								class="required "></span> ${text('所聘岗位')}：<i
								class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
									<#form:select id="employeePosts" path="employee.employeePosts" items="${postList}"
								itemLabel="postName" itemValue="postCode" class="form-control"/>
							</div>
							
<script type="text/javascript">
$(function() {
    $("#employeePosts").find("option[value='${empUser.employee.postCode}']").attr("selected",true);
})
</script>
			
						</div>
					</div>
				</div>

				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title=""> <span
								class="required ">*</span> ${text('供职院校')}：<i
								class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:treeselect id="office" title="${text('供职院校选择')}"
									path="employee.office.officeCode"
									labelPath="employee.office.officeName"
									url="${ctx}/sys/office/treeData?isAll=true" class="required"
									allowClear="false" callbackFuncName="officeCallback" />
							</div>
						</div>
					</div>

					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title=""> <span
								class="required hide">*</span> ${text('办学层次/办学性质')}：<i
								class="fa icon-question hide"></i></label> <label
								class="control-label col-sm-8" title="">
								<p class="text-left"><% if (empUser.employee.office!=null &&
									empUser.employee.office.extend!=null){ %>
									${empUser.employee.office.extend.extendS3}/${empUser.employee.office.extend.extendS4}
									<% if (empUser.employee.office.extend.extendS4==""){ %>公办<%}%>
									<%}%></p>
							</label>
						</div>
					</div>
				</div>

				<div class="row">

					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title=""> <span
								class="required hide"></span> ${text('供职院校所在区域')}：<i
								class="fa icon-question hide"></i></label> <label
								class="control-label col-sm-10" title="" id="office_area">
								
							</label>
						</div>
					</div>
				</div>


				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title=""> <span
								class="required">*</span> ${text('最高学历毕业院校')}：<i
								class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:treeselect id="company" title="${text('最高学历毕业院校选择')}"
									path="employee.company.companyCode"
									labelPath="employee.company.companyName" canSelectRoot="true"
									canSelectParent="true" callbackFuncName="companyCallback"
									class="required" url="${ctx}/sys/company/treeData?isAll=true"
									btnClass="" allowClear="true" />
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title=""> <span
								class="required hide"></span> ${text('学校所在区域')}：<i
								class="fa icon-question hide"></i></label> <label
								class="control-label col-sm-8" title="" id="company_area">
								<% if( empUser.employee.company!=null &&
								empUser.employee.company.area!=null){ %>
								<p class="text-left">${empUser.employee.company.area.treeNames}</p>
								<%}%>
							</label>
						</div>
					</div>
				</div>


				<div class="form-unit">${text('学历信息')}</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title=""> <span
								class="required ">*</span> ${text('最高学历')}：<i
								class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:select path="employee.highestEdu" dictType="highest_edu"
									class="form-control required" />



							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title=""> <span
								class="required ">*</span> ${text('最高学位')}：<i
								class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:select path="employee.highestDegree"
									dictType="highest_degree" blankOption="true"
									onchange="findHighestDegree(this.options[this.options.selectedIndex].value);"
									class="form-control required" />

								<input name="highestDegreeEmp" maxlength="64"
									class="form-control " id="highestDegreeEmp"
									style="display: none;" />
							</div>
						</div>
					</div>

					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title=""> <span
								class="required ">*</span> ${text('最高学历所学专业')}：<i
								class="fa icon-question hide"></i></label>
							<div class="col-sm-10">

								<#form:treeselect id="subjectMajor" title="最高学历所学专业"
									path="employee.subjectMajor.dictCode"
									labelPath="employee.subjectMajor.dictLabel"
									url="${ctx}/edu/eduSubject/treeData?dictType=edu_benke&isAll=true"
									class="required" allowClear="true" canSelectRoot="true"
									canSelectParent="true" isReturnValue="false" />
							</div>
						</div>
					</div>

					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title=""> <span
								class="required ">*</span> ${text('博士后')}：<i
								class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<#form:radio path="employee.isPostdoctor" dictType="sys_yes_no"
									class="form-control required" />
							</div>
						</div>
					</div>
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title=""> <span
								class="required ">*</span> ${text('国（境）外学习情况')}：<i
								class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<#form:select path="employee.learningSituation"
									dictType="school_abroad" blankOption="true"
									class="form-control required"
									onchange="findtemplateLearningSituation(this.options[this.options.selectedIndex].value);" />
							</div>
							
							
							
						</div>
						
					</div>

					<div class="col-xs-12 <% if(empUser.employee.learningSituationExt==null||empUser.employee.learningSituationExt=='') {%>hidden<%}%>" id="learningSituation_div">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								${text('学校名称')}：<i class="fa icon-question hide"></i>
							</label>
							<div class="col-sm-10">
									<#form:input path="employee.learningSituationExt" id="learningSituationExt" class="form-control " />
							</div>
						</div>
					</div>
				</div>
				<div class="form-unit">${text('职称信息')}</div>
				<div class="row">

					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title=""> <span
								class="required ">*</span> ${text('专业技术职务1')}：<i
								class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<#form:treeselect id="eduTeacherTitle" title="专业技术职务1"
									path="employee.eduTeacherTitle.teacherId"
									labelPath="employee.eduTeacherTitle.teacherName"
									url="${ctx}/edu/eduTeacherTitle/treeData?isAll=true"
									class="required" allowClear="true" canSelectRoot="true"
									canSelectParent="true" isReturnValue="false" />
							</div>
						</div>
					</div>


					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title=""> <span
								class="required hide">*</span> ${text('专业技术职务2')}：<i
								class="fa icon-question hide"></i></label>
							<div class="col-sm-10">


								<#form:treeselect id="eduProfessionalTitle" title="专业技术职务2"
									path="employee.eduProfessionalTitle.professionalId"
									labelPath="employee.eduProfessionalTitle.professionalName"
									url="${ctx}/edu/eduProfessionalTitle/treeData?isAll=true"
									class="required" allowClear="true" canSelectRoot="true"
									canSelectParent="true" isReturnValue="false" />
							</div>
						</div>
					</div>
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title=""> <span
								class="required ">*</span> ${text('人才称号')}：<i
								class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<table id="testDataChildDataGrid"></table>
								<a href="#" id="testDataChildDataGridAddRowBtn"
									class="btn btn-primary btn-sm mt10 mb10"><i
									class="fa fa-plus"></i> 增行</a>
							</div>
						</div>
					</div>
				</div>
				<div class="form-unit">${text('从教专业信息')}</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title=""> <span
								class="required ">*</span> ${text('所教授的学生层次')}：<i
								class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:select path="employee.studentLevel"
									dictType="sys_student_level" blankOption="true"
									class="form-control required"
									onchange="findtemplate(this.options[this.options.selectedIndex].value);" />
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title=""> <span
								class="required ">*</span> ${text('学科门类')}：<i
								class="fa icon-question hide"></i></label>
							<div class="col-sm-8">

								<#form:treeselect id="subject" title="学科门类"
									path="employee.subject.dictCode" labelPath="employee.subject.dictLabel"
									url="${ctx}/edu/eduSubject/treeData?dictType=edu_benke&isAll=true"
									class="required" allowClear="true" canSelectRoot="true"
									canSelectParent="true" isReturnValue="false" />

							</div>
						</div>
					</div>

					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title=""> <span
								class="required ">*</span> ${text('担任导师')}：<i
								class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:radio path="employee.mentor" dictType="sys_mentor"
									class="form-control required" />
							</div>
						</div>
					</div>

				</div>
				<div class="form-unit">${text('研究方向信息')}</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title=""> <span
								class="required ">*</span> ${text('本人专业研究方向学科门类')}：<i
								class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:treeselect id="subjectResearch" title="本人专业研究方向学科门类"
									path="employee.subjectResearch.dictCode"
									labelPath="employee.subjectResearch.dictLabel"
									url="${ctx}/edu/eduSubject/treeData?self=true" class="required"
									allowClear="true" canSelectRoot="true" canSelectParent="true"
									isReturnValue="false" />
							</div>
						</div>
					</div>


				</div>

				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title=""> <span
								class="required ">*</span> ${text('专业研究主要面向哪类行业(研究领域对口的行业)')}：<i
								class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<#form:treeselect id="eduIndustry"
									title="专业研究主要面向哪类行业（研究领域对口的行业）" path="employee.eduIndustry.treeCode"
									labelPath="employee.eduIndustry.treeName"
									url="${ctx}/edu/eduIndustry/treeData?isAll=true"
									class="required" allowClear="true" canSelectRoot="true"
									canSelectParent="false" isReturnValue="false" />
							</div>
						</div>
					</div>
				</div>

				<div class="form-unit">${text('兼职信息')}</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title=""> <span
								class="required ">*</span> ${text('学校兼职')}：<i
								class="fa icon-question hide"></i></label>
							<div class="col-sm-4">
								<#form:select path="employee.schoolJob" dictType="school_job"
									blankOption="true" class="form-control required"
									onchange="findSchoolJob(this.options[this.options.selectedIndex].value,this.options[this.options.selectedIndex].text);" />
							</div>
							<div class="form-group <% if(empUser.employee.schoolJobExt==null||empUser.employee.schoolJobExt=='') {%>hidden<%}%>" id="schoolJobExt_div">
								<label class="control-label col-sm-2" title=""> <span
									class="required ">*</span> ${text('学校信息')}：<i
									class="fa icon-question hide"></i></label>
								<div class="col-sm-4">
									<#form:input path="employee.schoolJobExt" id="schoolJobExt" class="form-control " />
								</div>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title=""> <span
								class="required ">*</span> ${text('企业兼职')}：<i
								class="fa icon-question hide"></i></label>
							<div class="col-sm-4">
								<#form:select path="employee.industryJob"
									dictType="industry_job" blankOption="true"
									class="form-control required"
									onchange="findIndustryJob(this.options[this.options.selectedIndex].value,this.options[this.options.selectedIndex].text);" />
							</div>


							<div class="form-group <% if(empUser.employee.industryJobExt==null||empUser.employee.industryJobExt=='') {%>hidden<%}%>" id="industryJobExt_div">
								<label class="control-label col-sm-2" title=""> <span
									class="required ">*</span> ${text('企业信息')}：<i
									class="fa icon-question hide"></i></label>
								<div class="col-sm-4">
									<#form:input path="employee.industryJobExt" id="industryJobExt"
										class="form-control " />
								</div>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
						<div class="col-xs-12">
							<div class="form-group">
								<label class="control-label col-sm-2" title=""> <span
									class="required ">*</span> ${text('国（境）外工作情况')}：<i
									class="fa icon-question hide"></i></label>
								<div class="col-sm-4">
									<#form:select path="employee.workJob" dictType="work_abroad"
										blankOption="true" class="form-control required" onchange="findWorkJob(this.options[this.options.selectedIndex].value,this.options[this.options.selectedIndex].text);"/>
								</div>
								
								<div class="form-group <% if(empUser.employee.workJobExt==null||empUser.employee.workJobExt=='') {%>hidden<%}%>" id="workJobExt_div">
								<label class="control-label col-sm-2" title=""> <span
									class="required ">*</span> ${text('国外工作企业信息')}：<i
									class="fa icon-question hide"></i></label>
								<div class="col-sm-4">
									<#form:input path="employee.workJobExt" id="workJobExt"
										class="form-control " />
								</div>
							</div>
							</div>
						</div>
					</div>

					<div class="form-unit">${text('机构信息')}</div>
					<div class="row">
						<div class="col-xs-12">
							<div class="form-group">
								<label class="control-label col-sm-2" title=""> <span
									class="required hide">*</span> ${text('所属机构')}：<i
									class="fa icon-question hide"></i></label>
								<div class="col-sm-4">

									<#form:treeselect id="eduTwoOrganization" title="所属机构"
										path="employee.eduTwoOrganization.dictCode"
										labelPath="employee.eduTwoOrganization.dictLabel"
										url="${ctx}/edu/eduTwoOrganization/treeData" allowClear="true"
										canSelectRoot="true" canSelectParent="false"
										isReturnValue="false" />
								</div>
							</div>
						</div>
						<div class="col-xs-12">
							<div class="form-group">
								<label class="control-label col-sm-2" title=""> <span
									class="required hide">*</span> ${text('所在内设机构职务')}：<i
									class="fa icon-question hide"></i></label>
								<div class="col-sm-4">
									<#form:input path="employee.organization" maxlength="64"
										class="form-control " />
								</div>
							</div>
						</div>

					</div>

					<div class="row">
						<div class="col-xs-12">
							<div class="form-group">
								<label class="control-label col-sm-2" title=""> <span
									class="required hide">*</span> ${text('备注信息')}：<i
									class="fa icon-question hide"></i></label>
								<div class="col-sm-10">
									<#form:textarea path="employee.remarks" rows="4"
										maxlength="500" class="form-control" />
								</div>
							</div>
						</div>
					</div>


				</div>
				<div class="box-footer">
					<div class="row">
						<div class="col-sm-offset-2 col-sm-10">
							<button type="button" class="btn btn-sm btn-default"
								id="btnCancel" onclick="js.closeCurrentTabPage()">
								<i class="fa fa-reply-all"></i> ${text('确认信息无改动')}
							</button>
							&nbsp;
							<button type="submit" class="btn btn-sm btn-primary"
								id="btnSubmit">
								<i class="fa fa-check"></i> ${text('修 改')}
							</button>
							

							
						</div>
					</div>
				</div>
		</#form:form>
	</div>
</div>
<% } %>

<script>
//初始化测试数据子表DataGrid对象
$("#testDataChildDataGrid").dataGrid({

	data: ${toJson(empUser.employee.testDataChildList)},
	datatype: "local", // 设置本地数据
	autoGridHeight: function(){return 'auto'}, // 设置自动高度
	
	// 设置数据表格列
	columnModel: [
		{header:'状态', name:'status', editable:true, hidden:true},
		{header:'主键', name:'id', editable:true, hidden:true},
	
		{header:'获得人才称号名称', name:'talentCode', 
			editable:true, edittype:'select', editoptions:{'class':'form-control required',
				items: $.merge([{dictLabel:'&nbsp;',dictValue:''}], ${@DictUtils.getDictListJson('sys_talent')}),
				itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
					$(element).select2().on("change",function(){
						
						var id = $(this).attr("id");
						var idx = id.split("_");
						var talentYear = $("#"+idx[0] + "_talentYear")
						if($(this).val()=="37"){
							talentYear.val("2019");
						}
						$(this).valid()
					});
				}
			}
		},
		
		{header:'入选年份', name:'talentYear', width:80, 
			
			editable:true, edittype:'text', editoptions:{'class':'form-control Wdate required', 'readonly':'true',
				dataInit: function(element){ $(element).on('focus', function(){
					WdatePicker({dateFmt:'yyyy',isShowClear:false});
				});
			}}
		},
		
		{header:'操作', name:'actions', width:80, sortable:false, fixed:true, formatter: function(val, obj, row, act){
			var actions = [];
			if (val == 'new'){
				actions.push('<a href="#" onclick="js.confirm(\'你确认要删除这条数据吗？\', function(){$(\'#testDataChildDataGrid\').dataGrid(\'delRowData\',\''+obj.rowId+'\')});return false;"><i class="fa fa-trash-o"></i></a>&nbsp;');
			}else{
				actions.push('<a href="#" onclick="js.confirm(\'你确认要删除这条数据吗？\', function(){$(\'#testDataChildDataGrid\').dataGrid(\'setRowData\',\''+obj.rowId+'\',null,{display:\'none\'})});$(\'#'+obj.rowId+'_status\').val(\''+Global.STATUS_DELETE+'\');return false;"><i class="fa fa-trash-o"></i></a>&nbsp;');
			}
			return actions.join('');
		}, editoptions: {defaultValue: 'new'}}
	],
	
	// 编辑表格参数
	editGrid: true,				// 是否是编辑表格
	editGridInitRowNum: 1,		// 编辑表格的初始化新增行数
	editGridAddRowBtn: $('#testDataChildDataGridAddRowBtn'),	// 子表增行按钮
	editGridAddRowInitData: {id: '', status: Global.STATUS_NORMAL},	// 新增行的时候初始化的数据
	
	// 编辑表格的提交数据参数
	editGridInputFormListName: 'employee.testDataChildList', // 提交的数据列表名
	editGridInputFormListAttrs: 'status,id,talentCode,talentYear,', // 提交数据列表的属性字段
	
	// 加载成功后执行事件
	ajaxSuccess: function(data){
		
	}
});

function findtemplate(val){
	var subjectDiv = $("#subjectDiv");
	if(val==6){
		$("#subjectDiv").attr("data-url","${ctx}/edu/eduSubject/treeData?dictType=edu_gaozhi&isAll=true")
	}else if(val==7){
		$("#subjectDiv").attr("data-url","${ctx}/edu/eduSubject/treeData?dictType=edu_nothing&isAll=true")
	}else{
		$("#subjectDiv").attr("data-url","${ctx}/edu/eduSubject/treeData?dictType=edu_benke&isAll=true")
	}
	
	
	$("[name='employee.mentor']").each(function(){
		
	});
}

function findHighestDegree(val){
	console.log("创建文本框,进行相关数据存储");
}

function findtemplateLearningSituation(val){
	$("#learningSituation_div").removeClass('hidden');
	if(val==1){
		$("#learningSituationExt").val("");
		$("#learningSituation_div").addClass('hidden');
	}
	
	console.log("创建文本框,进行相关数据存储");
}




function findWorkJob(val,text){
	
	$("#workJobExt_div").addClass('hidden');
	if(val!=1){
		$("#workJobExt_div").removeClass('hidden');
		 
	}else{
		$("#workJobExt").val("");
	}
}


function findSchoolJob(val,text){
	
	$("#schoolJobExt_div").addClass('hidden');
	if(val!=6){
		$("#schoolJobExt_div").removeClass('hidden');
		$("#schoolJobExt_div .col-sm-2").html(text); 
	}else{
		$("#schoolJobExt").val("");
	}
}

function findIndustryJob(val,text){
	$("#industryJobExt_div").addClass('hidden');
	if(val!=5){
		$("#industryJobExt_div").removeClass('hidden');
		$("#industryJobExt_div .col-sm-2").html(text);
	}else{
		$("#industryJobExt").val("");
	}
}
function companyCallback(id, act, index, layero, nodes){
	
	if (act == 'ok'&&nodes.length>0){
		var selectData = nodes[0];
		
		if(selectData.id=='0000000000'||selectData.id=='4265051061'||selectData.id=='4265051062'||selectData.id=='4265051063'){
			layer.prompt({title: '请输入院校名称'}, function(text, index){
				$("#companyName").val(text);
				layer.close(index);
			});
		}else{
			ajaxCompany(selectData.id,$("#company_area"));
		}
	}
}

function officeCallback(id, act, index, layero, nodes){

	if (act == 'ok'&&nodes.length>0){
		var selectData = nodes[0];
		if(selectData.id=='0000000000'||selectData.id=='4265051061'||selectData.id=='4265051062'||selectData.id=='4265051063'){
			layer.prompt({title: '请输入院校名称'}, function(text, index){
				$("#officeName").val(text);
				layer.close(index);
			});
		}else{
			ajaxCompany(selectData.id,$("#office_area"));
		}
	}
	
}
$(document).ready(function(){
	
	ajaxCompany(${empUser.employee.office.officeCode},$("#office_area"));
});
function ajaxCompany(id,obj){
	if(id!=null){
		$.post("${ctx}/sys/company/ajaxCompany?id="+id, function(data){
			var list = data.list; 
		   if(list.length>0){
			   var company = list[0];
	
			   if(company!=null&&company.area!=null&&company.area.treeNames!=null){
				   obj.html('<p class="text-left">'+company.area.treeNames+'</p>')
			   }
		   }else{
			   obj.html("");
		   }
		});
	}
	
}

$("#inputForm").validate({
	submitHandler: function(form){
		js.ajaxSubmitForm($(form), function(data){
			js.showMessage(data.message);
			if(data.result == Global.TRUE){
				if(${action=='local'}){
					location.reload();
				}else{
					js.closeCurrentTabPage(function(contentWindow){
						contentWindow.page();
					});
				}
				
			}
		}, "json");
    }
});
</script>